import { fetch } from './service';
  
const Model = {
    namespace: 'messageandetails',
    state: {
        
    },

    effects: {
        *fetch({ payload }, { call }) {
            const response = yield call(fetch, payload);
            console.log(response)
            if (!response.List) {
                return { status: 500 }
            }
            const data = []
            response.List.map(item =>{
                data.push({
                    key: item.Id,
                    id: item.Id,
                    bluetooth: item.BeaconId,
                    temperature: item.Temp,
                    nk: item.NK,
                    gateway: item.GatewayTag,
                    scantime: item.ScanTime,
                })
                return 200
            })
            return {
                status: 200,
                totalPageSize: response.Page.TotalCount,
                data,
            }
        },

    },

    reducers: {
        
    },
}
export default Model;
  